package com.atguigu.common.valid;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.*;

/**
 * @author guanghaocheng
 * @version 1.0
 * 翼以尘雾之微补益山海,荧烛末光增辉日月
 * @date 2020/12/25 21:11
 */
//自定义的JSR303注解
@Documented
@Constraint(
        validatedBy = {ListValueConstraintValid.class}
)
@Target({ElementType.METHOD, ElementType.FIELD, ElementType.ANNOTATION_TYPE, ElementType.CONSTRUCTOR, ElementType.PARAMETER})
@Retention(RetentionPolicy.RUNTIME)
public @interface ListValue {

    String message() default "{com.atguigu.common.valid.ListValue.message}";//去这个ListValue全类名下的这个message去拿错误信息

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};

    int [] vals() default { };//自定义的，默认没有值
}
